<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="css/title.css"/>

<style type="text/css">
	#d0{
		height: 800px;
		width: 1000px;
		margin: auto;
		/*background: skyblue;*/
	}
	#top{
		margin: auto;
	}
	input{
		border: none;
		border-bottom: solid 1px;
		width: 1000px;
	}
	#text{
		height: 30px;
		font-size: 30px;
	}
	#content{
		height: 400px;
		width: 1000px;
		border: none;
		font-size: 22px;
	}
	#submit1{
		background:rgb(255,102,51);
		width: 60px;
		color:#fff;
	}
</style>
	<link rel="stylesheet" type="text/css" href="js/jquery-easyui-1.4.5/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="js/jquery-easyui-1.4.5/themes/icon.css">
	<script type="text/javascript" src="js/jquery-easyui-1.4.5/jquery.min.js"></script>
	<script type="text/javascript" src="js/jquery-easyui-1.4.5/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="js/jquery-easyui-1.4.5/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript">
	function a(){
		if (document.getElementById("text").value.trim()=="请输入帖子标题") {
			document.getElementById("text").value="";
		}
	}
	function d(){
		if (document.getElementById("content").value.trim()=="从这里开始分享") {
			document.getElementById("content").value="";
		}
	}
	function b(){
			if (document.getElementById("text").value.trim()=="") {
				document.getElementById("text").value="请输入帖子标题";
			}
	}
	function c(){
			if (document.getElementById("content").value.trim()=="") {
				document.getElementById("content").value="从这里开始分享";
			}
	}

    function check(form) {
    	console.log("why");
         if(document.getElementById("text").value.trim()==''||document.getElementById("text").value.trim()=="请输入帖子标题") {
               alert("请输入帖子标题!");
               form.text.focus();
               return false;
          }
          if(document.getElementById("content").value.trim()==''||document.getElementById("content").value.trim()=="从这里开始分享"){
               alert("请输入帖子内容!");
               form.content.focus();
               return false;
            }
          document.myform.submit();
    }



	</script>
</head>
<body>
	<div id="top" class="top">
		    <div id="top1">
		    	<div id="logo"><a href="login.html"  target="_self"><img src="img/logoword.jpg"/></div>
		    	
		    </div>
		    <div id="top2"  class="container">
	            <section class="c1">
		            <nav class="cl">
			 		<a href="main.html" target="_self" data-hover="主页"><span>主页</span></a>
					<a href="addR.html" target="_self" data-hover="美食收录"><span>美食收录</span></a>
					<a href="block.html" target="_self" data-hover="交流圈子"><span>交流圈子</span></a>
					<a href="usermain.html" target="_self" data-hover="个人主页"><span>个人主页</span></a>
		            </nav>
	            </section>	
            </div>
		     <div id="top3"></div>
		</div>
		<div id="bag">
			<div id="d0">
				<form action="block?method=sendpost" method="post" name="myform" id="myform">
				<input type="text" name="text" id="text" value="请输入帖子标题" onkeydown="a()" onblur="b()"/>
				<div></div> 
				<textarea name="content" id = "content" value="" onkeydown="d()" onblur="c()">从这里开始分享</textarea>
				<div id="">
					<input type="button" name="submit1" id="submit1" value="发布"  onclick="check(this.form)"/ >
					<select name="sel" value="">
						<option value="1">美食推荐</option>
						<option value="2">厨艺交流</option>
						<option value="3">饮食健康</option>
						<option value="4">日常分享</option>
					</select>#请选择发布板块
				</div>
				</form>
			</div>
		</div>
</body>
</html>